package com.sky.constants;

/**
 * @projectName: netty-cloud
 * @package: com.sky.constants
 * @className: SecurityConstants
 * @author: zhl
 * @description: TODO
 * @date: 2024/4/29 11:16
 * @version: 1.0
 */
public class SecurityConstants {

    /** 短信验证码登录 **/
    public static final String SMS_LOGIN_TYPE = "smsCaptcha";

    /** 图形验证码登录 **/
    public static final String IMAGE_LOGIN_TYPE = "imageCaptcha";

    /** 三方登录类型——Gitee **/
    public static final String THIRD_LOGIN_GITEE = "gitee";

    public static final String AUTHORITIES_KEY = "AUTHORITIES_KEY:";

    /**
     * oauth协议中有nonce参数，为防止冲突，nonce参数改为nonceId:随机字符串请求头名字
     */
    public static final String NONCE_HEADER_NAME = "nonceId";

    /**
     * 认证信息存储前缀
     */
    public static final String SECURITY_CONTEXT_PREFIX_KEY = "security_context:";

    /**
     * redis数据过期时间
     */
    public static final Integer DEFAULT_TIMEOUT_SECONDS = 60;

    /**
     * 存储token
     */
    public static ThreadLocal<String> tokenThreadLocal = new ThreadLocal<>();


    /**
     * 微信登录相关参数——openid：用户唯一id
     */
    public static final String WECHAT_PARAMETER_OPENID = "openid";

    /**
     * 微信登录相关参数——forcePopup：强制此次授权需要用户弹窗确认
     */
    public static final String WECHAT_PARAMETER_FORCE_POPUP = "forcePopup";

    /**
     * 微信登录相关参数——secret：微信的应用秘钥
     */
    public static final String WECHAT_PARAMETER_SECRET = "secret";

    /**
     * 微信登录相关参数——appid：微信的应用id
     */
    public static final String WECHAT_PARAMETER_APPID = "appid";

    /**
     * 三方登录类型——微信
     */
    public static final String THIRD_LOGIN_WECHAT = "wechat";
}
